CC = gcc
CFLAGS = -O3 
LDFLAGS = 
LIBS     = 

TEST = test
TEST_O = sa.o test.o

all: test_objs test_prog

sha1_prog:
	$(CC) $(CFLAGS) $(LDLAGS) -o $(SHA1) $(SHA1_O) $(LIBS)

sha1_objs:   $(SHA1_O)

test_prog:
	$(CC) $(CFLAGS) $(LDLAGS) -o $(TEST) $(TEST_O) $(LIBS)

test_objs:   $(TEST_O)

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $< 

.c.s:
	$(CC) $(CFLAGS) -S -o $*.s $<

.o:
	$(CC) $(CFLAGS) $(LDLAGS) -o $* $(SHA1_O) $(LIBS)

clean: cleanbin
	rm -f *.o *~

cleanbin:
	rm -f $(SHA1) $(TEST)

